export const isChinese = (str) => {
  let pattern = new RegExp('[\u4E00-\u9FA5]+')
  if (pattern.test(str)) {
    return true
  }
}

export const getFirstChinese = (str, reverse) => {
  if (str) {
    str = reverse ? str.split('').reverse().join('') : str
    for (let i = 0; i < str.length; i++) {
      if (isChinese(str[i])) {
        return str[i]
      }
    }
  }
  return ''
}
